package cn.yuanqiao.archive.fondsFolder.domain;

import cn.yuanqiao.common.annotation.IdAnnotation;
import cn.yuanqiao.common.exception.ServiceException;
import cn.yuanqiao.common.utils.StringUtils;
import cn.yuanqiao.common.core.domain.BaseEntity;
import cn.yuanqiao.common.utils.SecurityUtils;

public class Model extends BaseEntity {
    private static final long serialVersionUID = 1L;

    private final String BIGTABLENAME = "_MODELMANAGE";

    public Model() {
        String tenantCode = SecurityUtils.getTenantCode();
        if(StringUtils.isEmpty(tenantCode)){
            throw new ServiceException("tenantCode is null");
        }else {
            this.tableName = tenantCode.toUpperCase()+BIGTABLENAME;
        }
    }

    @IdAnnotation
    private Long id;

    private String tableName;

    private String fileName;

    private String path;

    private String prefix;
    // 1：大事记模板 2：组织沿革模板
    private Integer type;
    // 1：删除 0：未删除
    private Integer isDel;

    private Long deptId;

    private Long userId;

    private String mj;

    public String getMj() {
        return mj;
    }

    public void setMj(String mj) {
        this.mj = mj;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getTableName() {
        return tableName;
    }

    public void setTableName(String tableName) {
        this.tableName = tableName;
    }

    public String getFileName() {
        return fileName;
    }

    public void setFileName(String fileName) {
        this.fileName = fileName;
    }

    public String getPath() {
        return path;
    }

    public void setPath(String path) {
        this.path = path;
    }

    public String getPrefix() {
        return prefix;
    }

    public void setPrefix(String prefix) {
        this.prefix = prefix;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public Integer getIsDel() {
        return isDel;
    }

    public void setIsDel(Integer isDel) {
        this.isDel = isDel;
    }

    public Long getDeptId() {
        return deptId;
    }

    public void setDeptId(Long deptId) {
        this.deptId = deptId;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    @Override
    public String toString() {
        return "Model{" +
                "id=" + id +
                ", tableName='" + tableName + '\'' +
                ", fileName='" + fileName + '\'' +
                ", path='" + path + '\'' +
                ", prefix='" + prefix + '\'' +
                ", type=" + type +
                ", isDel=" + isDel +
                ", deptId=" + deptId +
                ", userId=" + userId +
                '}';
    }
}
